package annotation.basedJava;

import annotation.bean.People;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(Config2.class)
public class Config {
    @Bean
    public People getPeople(){
        final People people = new People();
        people.setAge(28);
        people.setName("Ocean");
        return people;
    }
    // 通过调用方法完成注入
    @Bean
    public Peoples getPeoples(){
        return new Peoples(getPeople());
    }
}
